<?php
/**
 * Created by PhpStorm.
 * User: cen
 * Date: 2020/6/8
 * Time: 23:09
 */

namespace app\index\validate;


use think\Validate;

class User extends Validate
{
    protected $rule =   [
        'username'  => 'require',
        'password'   => 'require',
        'repassword' => 'require|confirm:password',
    ];

    protected $message  =   [
        'username.require' => '用户名不能为空',
        'password.require'     => '密码不能为空',
        'repassword.require' => '重复密码不能为空',
        'repassword.confirm' => '二次密码不相同',

    ];

    protected $scene = [
        'login'  =>  ['username','password'],
        'register' => ['username','password','repassword'],
    ];

}